﻿Public Class LoginAdapter
    Inherits FormAdapter(Of frmLogin, LoginListener)

    Public Sub New()
        MyBase.New(New frmLogin)
    End Sub

    Private WithEvents btnLogin As Button = form.btnLogin

    Public Sub loginFailed()
        showError("Name oder Passwort ist falsch.")
    End Sub

    Private Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
        form.Enabled = False
        For Each listener As LoginListener In getObservable().getListeners
            listener.loginPerformed(form.txtUsername.Text, form.txtPassword.Text)
        Next
        form.Enabled = True
    End Sub
End Class
